package com.lmiot.xyclick.Method;

import android.app.Dialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.lmiot.xyclick.App.MyApp;
import com.lmiot.xyclick.Auto.AutoUtils;
import com.lmiot.xyclick.Bean.IfBean;
import com.lmiot.xyclick.Bean.IfBeanColor;
import com.lmiot.xyclick.Bean.InitFloatBean;
import com.lmiot.xyclick.Bean.ItemActionBean;
import com.lkx.liandianqinew.R;
import com.lmiot.xyclick.Util.Constants;
import com.lmiot.xyclick.Util.DataUtil;
import com.lmiot.xyclick.Util.EditDialogUtil;
import com.lmiot.xyclick.Util.FloatManager;
import com.lmiot.xyclick.Util.ImgUtil;
import com.lmiot.xyclick.Util.LayoutDialogUtil;
import com.lmiot.xyclick.Util.TimeUtils;
import com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK;
import com.youyi.yyviewsdklibrary.Dialog.util.ToastUtil;
import java.util.ArrayList;
import java.util.List;

public class ChoseActionIFUtil {
    public static OnChoseIfBeanListener mOnChoseIfBeanListener;
    private static final ChoseActionIFUtil ourInstance = new ChoseActionIFUtil();
    private ActionAdapter mActionAdapter;
    private Dialog mDialog;
    private Intent mIntent;
    private List<ItemActionBean> mItemActionBeanList;

    public interface OnChoseIfBeanListener {
        void result(IfBean ifBean);
    }

    public static ChoseActionIFUtil getInstance() {
        return ourInstance;
    }

    private ChoseActionIFUtil() {
    }

    public void showChoseDialog(String str, OnChoseIfBeanListener onChoseIfBeanListener) {
        mOnChoseIfBeanListener = onChoseIfBeanListener;
        Dialog dialog = this.mDialog;
        if (dialog != null && dialog.isShowing()) {
            this.mDialog.dismiss();
        }
        Dialog createBottomDailogNew = LayoutDialogUtil.createBottomDailogNew(MyApp.getContext(), R.layout.dialog_chose_action_if);
        this.mDialog = createBottomDailogNew;
        ((TextView) createBottomDailogNew.findViewById(R.id.id_title)).setText(str);
        ifActionList((ListView) this.mDialog.findViewById(R.id.id_listview));
        ((TextView) this.mDialog.findViewById(R.id.id_save)).setOnClickListener(new View.OnClickListener() {
            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass1 */

            public void onClick(View view) {
                AutoUtils.resumeAddActivity(MyApp.getContext());
                if (ChoseActionIFUtil.this.mDialog != null && ChoseActionIFUtil.this.mDialog.isShowing()) {
                    ChoseActionIFUtil.this.mDialog.dismiss();
                }
            }
        });
    }

    private void ifActionList(ListView listView) {
        ArrayList arrayList = new ArrayList();
        this.mItemActionBeanList = arrayList;
        arrayList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_text_full));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_wait_text));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_wait_img));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_text_rect));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_text_full_ocr));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_text_rect_ocr));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_img_full));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_img_rect));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_num_dot));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_num_android));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_num));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_time));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_color_point));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_color_screen));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_color_more));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_color_rect));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_str_length));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_str_contain));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_str_start));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.IF, Constants.ActionEnum.If_str_end));
        ActionAdapter actionAdapter = new ActionAdapter(this.mItemActionBeanList);
        this.mActionAdapter = actionAdapter;
        listView.setAdapter((ListAdapter) actionAdapter);
    }

    public ItemActionBean getItemByEume(Constants.TypeGroup typeGroup, Constants.ActionEnum actionEnum) {
        return new ItemActionBean(typeGroup, actionEnum.getType(), null, actionEnum.getImg(), actionEnum.getName(), actionEnum.getDetail(), actionEnum.isVip());
    }

    /* access modifiers changed from: private */
    public class ActionAdapter extends BaseAdapter {
        List<ItemActionBean> list;

        public Object getItem(int i) {
            return null;
        }

        public long getItemId(int i) {
            return 0;
        }

        public ActionAdapter(List<ItemActionBean> list2) {
            this.list = list2;
        }

        public int getCount() {
            List<ItemActionBean> list2 = this.list;
            if (list2 == null) {
                return 0;
            }
            return list2.size();
        }

        public View getView(int i, View view, ViewGroup viewGroup) {
            View inflate = View.inflate(MyApp.getContext(), R.layout.item_chose_action, null);
            ImageView imageView = (ImageView) inflate.findViewById(R.id.id_icon);
            ImageView imageView2 = (ImageView) inflate.findViewById(R.id.id_img);
            TextView textView = (TextView) inflate.findViewById(R.id.id_name);
            TextView textView2 = (TextView) inflate.findViewById(R.id.id_detail);
            final ItemActionBean itemActionBean = this.list.get(i);
            Drawable appIcon = itemActionBean.getAppIcon();
            if (appIcon == null) {
                imageView.setVisibility(View.GONE);
                imageView2.setVisibility(View.VISIBLE);
                Glide.with(MyApp.getContext()).load(Integer.valueOf(itemActionBean.getActionImg())).into(imageView2);
            } else {
                imageView.setVisibility(View.VISIBLE);
                imageView2.setVisibility(View.GONE);
                imageView.setImageDrawable(appIcon);
            }
            textView.setText(itemActionBean.getActionName());
            if (TextUtils.isEmpty(itemActionBean.getActionDetail())) {
                textView2.setVisibility(View.GONE);
            } else {
                textView2.setVisibility(View.VISIBLE);
                textView2.setText(itemActionBean.getActionDetail());
            }
            inflate.setOnClickListener(new View.OnClickListener() {
                /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.ActionAdapter.AnonymousClass1 */

                public void onClick(View view) {
                    if (!itemActionBean.isVip() || DataUtil.getVip(MyApp.getContext())) {
                        ChoseActionIFUtil.this.clickAction(itemActionBean);
                        return;
                    }
                    ChoseActionIFUtil.this.mDialog.dismiss();
                    LayoutDialogUtil.checkVIP(MyApp.getContext());
                }
            });
            return inflate;
        }
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void clickAction(ItemActionBean itemActionBean) {
        final IfBean ifBean = new IfBean();
        ifBean.setType(itemActionBean.getActionType());
        String actionType = itemActionBean.getActionType();
        actionType.hashCode();
        char c = 65535;
        switch (actionType.hashCode()) {
            case -1815477287:
                if (actionType.equals(Constants.ACTION_TYPE_IF_BIG)) {
                    c = 0;
                    break;
                }
                break;
            case -1815463837:
                if (actionType.equals(Constants.ACTION_TYPE_IF_IMG)) {
                    c = 1;
                    break;
                }
                break;
            case -1806167109:
                if (actionType.equals(Constants.ACTION_TYPE_IF_STR_LENGTH)) {
                    c = 2;
                    break;
                }
                break;
            case -1465745048:
                if (actionType.equals(Constants.ACTION_TYPE_IF_BIG_ANDROID)) {
                    c = 3;
                    break;
                }
                break;
            case -1172618801:
                if (actionType.equals(Constants.ACTION_TYPE_IF_TEXT_RECT)) {
                    c = 4;
                    break;
                }
                break;
            case -915840004:
                if (actionType.equals(Constants.ACTION_TYPE_IF_COLOR)) {
                    c = 5;
                    break;
                }
                break;
            case -887424920:
                if (actionType.equals(Constants.ACTION_TYPE_IF_BIG_AND_DOT)) {
                    c = 6;
                    break;
                }
                break;
            case -735797586:
                if (actionType.equals(Constants.ACTION_TYPE_IF_TEXT_RECT_OCR)) {
                    c = 7;
                    break;
                }
                break;
            case -605553427:
                if (actionType.equals(Constants.ACTION_TYPE_IF_STR_START)) {
                    c = '\b';
                    break;
                }
                break;
            case -444688012:
                if (actionType.equals(Constants.ACTION_TYPE_IF_TEXT)) {
                    c = '\t';
                    break;
                }
                break;
            case -444684524:
                if (actionType.equals(Constants.ACTION_TYPE_IF_TIME)) {
                    c = '\n';
                    break;
                }
                break;
            case 732456607:
                if (actionType.equals(Constants.ACTION_TYPE_IF_STR_CONTAIN)) {
                    c = 11;
                    break;
                }
                break;
            case 1070540303:
                if (actionType.equals(Constants.ACTION_TYPE_IF_COLOR_SCREEN)) {
                    c = '\f';
                    break;
                }
                break;
            case 1399827896:
                if (actionType.equals(Constants.ACTION_TYPE_IF_COLOR_MORE)) {
                    c = '\r';
                    break;
                }
                break;
            case 1399966791:
                if (actionType.equals(Constants.ACTION_TYPE_IF_COLOR_RECT)) {
                    c = 14;
                    break;
                }
                break;
            case 1763285971:
                if (actionType.equals(Constants.ACTION_TYPE_IF_TEXT_OCR)) {
                    c = 15;
                    break;
                }
                break;
            case 1809410086:
                if (actionType.equals(Constants.ACTION_TYPE_IF_STR_END)) {
                    c = 16;
                    break;
                }
                break;
            case 2016976960:
                if (actionType.equals(Constants.ACTION_TYPE_IF_IMG_RECT)) {
                    c = 17;
                    break;
                }
                break;
        }
        switch (c) {
            case 0:
            case 3:
            case 6:
                this.mDialog.dismiss();
                ToastUtil.warning("请选择要判断的数字所在区域！");
                YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass6 */

                    @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                    public void result(boolean z, Rect rect) {
                        ifBean.setRect(rect);
                        EditDialogUtil.getInstance().choseBigger(MyApp.getContext(), "确认要判断的表达式", new EditDialogUtil.OnBiggerListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass6.AnonymousClass1 */

                            @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnBiggerListener
                            public void result(String str, int i) {
                                String str2;
                                ifBean.setSign(str);
                                ifBean.setValue(i);
                                str.hashCode();
                                char c = 65535;
                                switch (str.hashCode()) {
                                    case -1570081146:
                                        if (str.equals(Constants.SIGN_NOT_EQUAL)) {
                                            c = 0;
                                            break;
                                        }
                                        break;
                                    case -191459948:
                                        if (str.equals(Constants.SIGN_SMAL_AND_EQUAL)) {
                                            c = 1;
                                            break;
                                        }
                                        break;
                                    case 251373074:
                                        if (str.equals(Constants.SIGN_EQUAL)) {
                                            c = 2;
                                            break;
                                        }
                                        break;
                                    case 263818365:
                                        if (str.equals(Constants.SIGN_SAMLL)) {
                                            c = 3;
                                            break;
                                        }
                                        break;
                                    case 514467563:
                                        if (str.equals(Constants.SIGN_BIG_AND_EQUAL)) {
                                            c = 4;
                                            break;
                                        }
                                        break;
                                    case 1095229278:
                                        if (str.equals(Constants.SIGN_BIG)) {
                                            c = 5;
                                            break;
                                        }
                                        break;
                                }
                                switch (c) {
                                    case 0:
                                        str2 = "!=";
                                        break;
                                    case 1:
                                        str2 = "<=";
                                        break;
                                    case 2:
                                        str2 = "=";
                                        break;
                                    case 3:
                                        str2 = "<";
                                        break;
                                    case 4:
                                        str2 = ">=";
                                        break;
                                    case 5:
                                        str2 = ">";
                                        break;
                                    default:
                                        str2 = "";
                                        break;
                                }
                                ifBean.setIfName("条件：目标数字" + str2 + i);
                                if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                    ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                }
                            }
                        }, true);
                    }
                });
                return;
            case 1:
                this.mDialog.dismiss();
                ToastUtil.warning("请选择目标图片！");
                YYScreenCutSDK.getInstance().cutRect(MyApp.getContext(), null, new YYScreenCutSDK.OnCutListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass4 */

                    @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnCutListener
                    public void result(boolean z, Bitmap bitmap) {
                        String saveBitmpToFile = ImgUtil.saveBitmpToFile(bitmap, TimeUtils.createID());
                        ifBean.setImgPath(saveBitmpToFile);
                        ifBean.setIfName("检测图片：" + saveBitmpToFile);
                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                        }
                    }
                });
                return;
            case 2:
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.选择字符串所区域；\n\n2.确认字符串的长度范围；", 0, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass12 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        ToastUtil.warning("选择字符串所在区域！");
                        YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass12.AnonymousClass1 */

                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                            public void result(boolean z, Rect rect) {
                                ifBean.setRect(rect);
                                EditDialogUtil.getInstance().choseMaxAndMin(MyApp.getContext(), "字符串长度范围", new EditDialogUtil.OnMaxMinListener() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass12.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnMaxMinListener
                                    public void result(int i, int i2) {
                                        ifBean.setMinNum(i);
                                        ifBean.setMaxNum(i2);
                                        ifBean.setIfName("长度:" + i + "～" + i2);
                                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                        }
                                    }
                                }, true);
                            }
                        });
                    }
                }, true);
                return;
            case 4:
            case 7:
                this.mDialog.dismiss();
                ToastUtil.warning("请选择要文字所在区域！");
                YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass3 */

                    @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                    public void result(boolean z, Rect rect) {
                        ifBean.setRect(rect);
                        EditDialogUtil.getInstance().edit(MyApp.getContext(), 1, "要检测的文字", "请输入文字", "", new EditDialogUtil.EditMethod() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass3.AnonymousClass1 */

                            @Override // com.lmiot.xyclick.Util.EditDialogUtil.EditMethod
                            public void edit(String str) {
                                ifBean.setText(str);
                                ifBean.setIfName("检测区域文字(" + ifBean.getText() + ")");
                                if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                    ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                }
                            }
                        }, true);
                    }
                });
                return;
            case 5:
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.拖动以下蓝色图标到要取颜色的地方；\n\n2.长按瞄准图标选择颜色和位置；", R.drawable.location, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass8 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        MyApp.mOnActionViewLongClickListener = new MyApp.OnActionViewLongClickListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass8.AnonymousClass1 */

                            @Override // com.lmiot.xyclick.App.MyApp.OnActionViewLongClickListener
                            public void result(final int i, final int i2) {
                                MyApp.mOnActionViewLongClickListener = null;
                                FloatManager.hide(InitFloatBean.FloatType.action);
                                YYScreenCutSDK.getInstance().cutFull(MyApp.getContext(), new YYScreenCutSDK.OnCutListener() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass8.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnCutListener
                                    public void result(boolean z, Bitmap bitmap) {
                                        String colorByXY = YYScreenCutSDK.getColorByXY(bitmap, i, i2, true);
                                        FloatManager.show(InitFloatBean.FloatType.action);
                                        EditDialogUtil.getInstance().choseColor(MyApp.getContext(), "xy", "请确认位置和颜色", i, i2, null, colorByXY, new EditDialogUtil.OnColorListener() {
                                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass8.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                                            @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnColorListener
                                            public void result(IfBeanColor ifBeanColor) {
                                                ifBean.setIfBeanColor(ifBeanColor);
                                                ifBean.setIfName("颜色：" + ifBeanColor.getName());
                                                if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                                    ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                                }
                                            }
                                        }, true);
                                    }
                                });
                            }
                        };
                    }
                }, true);
                return;
            case '\b':
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.拖动选择字符串所在范围；\n\n2.输入字符串开头的字符；", 0, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass14 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        ToastUtil.warning("选择字符串所在区域！");
                        YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass14.AnonymousClass1 */

                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                            public void result(boolean z, Rect rect) {
                                ifBean.setRect(rect);
                                EditDialogUtil.getInstance().edit(MyApp.getContext(), 1, "开头字符串", "请输入开头字符串", "", new EditDialogUtil.EditMethod() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass14.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.EditMethod
                                    public void edit(String str) {
                                        ifBean.setText(str);
                                        ifBean.setIfName("包含：开头字符串" + str);
                                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                        }
                                    }
                                }, true);
                            }
                        });
                    }
                }, true);
                return;
            case '\t':
            case 15:
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().edit(MyApp.getContext(), 1, "检测的文字", "请输入文字", "", new EditDialogUtil.EditMethod() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass2 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.EditMethod
                    public void edit(String str) {
                        ifBean.setText(str);
                        ifBean.setIfName("检测全屏文字：" + ifBean.getText());
                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                        }
                    }
                }, true);
                return;
            case '\n':
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().choseTimer(MyApp.getContext(), "选择判断的时间范围", new EditDialogUtil.OnTimerListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass7 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnTimerListener
                    public void result(String str, String str2) {
                        ifBean.setStartTime(str);
                        ifBean.setEndTime(str2);
                        ifBean.setIfName("时间条件：" + str + "～" + str2);
                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                        }
                    }
                }, true);
                return;
            case 11:
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.拖动选择字符串所在范围；\n\n2.输入被包含的字符串；", 0, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass13 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        ToastUtil.warning("选择字符串所在区域！");
                        YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass13.AnonymousClass1 */

                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                            public void result(boolean z, Rect rect) {
                                ifBean.setRect(rect);
                                EditDialogUtil.getInstance().edit(MyApp.getContext(), 1, "包含的字符串", "请输入包含的字符串", "", new EditDialogUtil.EditMethod() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass13.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.EditMethod
                                    public void edit(String str) {
                                        ifBean.setText(str);
                                        ifBean.setIfName("包含：字符串" + str);
                                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                        }
                                    }
                                }, true);
                            }
                        });
                    }
                }, true);
                return;
            case '\f':
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.拖动以下蓝色图标到要取颜色的地方；\n\n2.长按瞄准图标选择目标颜色；", R.drawable.location, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass9 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        MyApp.mOnActionViewLongClickListener = new MyApp.OnActionViewLongClickListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass9.AnonymousClass1 */

                            @Override // com.lmiot.xyclick.App.MyApp.OnActionViewLongClickListener
                            public void result(final int i, final int i2) {
                                MyApp.mOnActionViewLongClickListener = null;
                                FloatManager.hide(InitFloatBean.FloatType.action);
                                YYScreenCutSDK.getInstance().cutFull(MyApp.getContext(), new YYScreenCutSDK.OnCutListener() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass9.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnCutListener
                                    public void result(boolean z, Bitmap bitmap) {
                                        String colorByXY = YYScreenCutSDK.getColorByXY(bitmap, i, i2, true);
                                        FloatManager.show(InitFloatBean.FloatType.action);
                                        EditDialogUtil.getInstance().choseColor(MyApp.getContext(), "full", "请确认位置和颜色", i, i2, null, colorByXY, new EditDialogUtil.OnColorListener() {
                                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass9.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                                            @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnColorListener
                                            public void result(IfBeanColor ifBeanColor) {
                                                ifBean.setIfBeanColor(ifBeanColor);
                                                ifBean.setIfName("颜色：" + ifBeanColor.getName());
                                                if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                                    ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                                }
                                            }
                                        }, true);
                                    }
                                });
                            }
                        };
                    }
                }, true);
                return;
            case '\r':
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.拖动选择判断的目标区域;\n\n2.拖动以下蓝色图标到要取颜色的地方;\n\n3.长按瞄准图标选择目标颜色;\n\n4.选择条件满足后要执行的动作;\n\n5.选择条件不满足后要执行的动作;", R.drawable.location, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass10 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        ToastUtil.warning("拖动选择判断的目标区域！");
                        YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass10.AnonymousClass1 */

                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                            public void result(boolean z, final Rect rect) {
                                EditDialogUtil.getInstance().choseColorList(MyApp.getContext(), rect, null, new EditDialogUtil.OnColorListener() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass10.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnColorListener
                                    public void result(IfBeanColor ifBeanColor) {
                                        EditDialogUtil.getInstance().choseColorList(MyApp.getContext(), rect, null, new EditDialogUtil.OnColorListener() {
                                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass10.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                                            @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnColorListener
                                            public void result(IfBeanColor ifBeanColor) {
                                                ifBean.setIfBeanColor(ifBeanColor);
                                                ifBean.setIfName("颜色：" + ifBeanColor.getName());
                                                if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                                    ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                                }
                                            }
                                        }, true);
                                    }
                                }, true);
                            }
                        });
                    }
                }, true);
                return;
            case 14:
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.拖动选择判断的目标区域；\n\n2.拖动以下蓝色图标到要取颜色的地方；\n\n3.长按瞄准图标选择目标颜色；", R.drawable.location, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass11 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        ToastUtil.info("拖动选择判断的目标区域！");
                        YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass11.AnonymousClass1 */

                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                            public void result(boolean z, Rect rect) {
                                ToastUtil.info("拖动瞄准图标，然后长按！");
                                MyApp.mOnActionViewLongClickListener = new MyApp.OnActionViewLongClickListener() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass11.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.App.MyApp.OnActionViewLongClickListener
                                    public void result(final int i, final int i2) {
                                        MyApp.mOnActionViewLongClickListener = null;
                                        FloatManager.hide(InitFloatBean.FloatType.action);
                                        YYScreenCutSDK.getInstance().cutFull(MyApp.getContext(), new YYScreenCutSDK.OnCutListener() {
                                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass11.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnCutListener
                                            public void result(boolean z, Bitmap bitmap) {
                                                String colorByXY = ImgUtil.getColorByXY(ImgUtil.zoomImg(bitmap, MyApp.mWidth), i, i2, true);
                                                FloatManager.show(InitFloatBean.FloatType.action);
                                                EditDialogUtil.getInstance().choseColor(MyApp.getContext(), "xy", "请确认位置和颜色", i, i2, null, colorByXY, new EditDialogUtil.OnColorListener() {
                                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass11.AnonymousClass1.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                                                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnColorListener
                                                    public void result(IfBeanColor ifBeanColor) {
                                                        ifBean.setIfBeanColor(ifBeanColor);
                                                        ifBean.setIfName("颜色：" + ifBeanColor.getName());
                                                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                                        }
                                                    }
                                                }, true);
                                            }
                                        });
                                    }
                                };
                            }
                        });
                    }
                }, true);
                return;
            case 16:
                this.mDialog.dismiss();
                EditDialogUtil.getInstance().sureDialog(MyApp.getContext(), "操作说明", "1.拖动选择字符串所在范围；\n\n2.输入字符串结尾的字符；", 0, new EditDialogUtil.setOnSureListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass15 */

                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.setOnSureListener
                    public void sureClick(boolean z) {
                        ToastUtil.warning("选择字符串所在区域！");
                        YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass15.AnonymousClass1 */

                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                            public void result(boolean z, Rect rect) {
                                ifBean.setRect(rect);
                                EditDialogUtil.getInstance().edit(MyApp.getContext(), 1, "结尾字符串", "请输入结尾字符串", "", new EditDialogUtil.EditMethod() {
                                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass15.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.Util.EditDialogUtil.EditMethod
                                    public void edit(String str) {
                                        ifBean.setText(str);
                                        ifBean.setIfName("包含：结尾字符串" + str);
                                        if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                            ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                        }
                                    }
                                }, true);
                            }
                        });
                    }
                }, true);
                return;
            case 17:
                this.mDialog.dismiss();
                ToastUtil.warning("请选择要图片所在区域！");
                YYScreenCutSDK.getInstance().getRectData(MyApp.getContext(), null, new YYScreenCutSDK.OnRectListener() {
                    /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass5 */

                    @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnRectListener
                    public void result(boolean z, Rect rect) {
                        ifBean.setRect(rect);
                        ToastUtil.warning("请选择目标图片！");
                        YYScreenCutSDK.getInstance().cutRect(MyApp.getContext(), null, new YYScreenCutSDK.OnCutListener() {
                            /* class com.lmiot.xyclick.Method.ChoseActionIFUtil.AnonymousClass5.AnonymousClass1 */

                            @Override // com.youyi.yyscreencutlibrary.SDK.YYScreenCutSDK.OnCutListener
                            public void result(boolean z, Bitmap bitmap) {
                                String saveBitmpToFile = ImgUtil.saveBitmpToFile(bitmap, TimeUtils.createID());
                                ifBean.setImgPath(saveBitmpToFile);
                                ifBean.setIfName("检测区域图片(" + saveBitmpToFile + ")");
                                if (ChoseActionIFUtil.mOnChoseIfBeanListener != null) {
                                    ChoseActionIFUtil.mOnChoseIfBeanListener.result(ifBean);
                                }
                            }
                        });
                    }
                });
                return;
            default:
                return;
        }
    }
}
